package com.ailanyin.common.security.factory;

import com.ailanyin.common.security.filter.JwtAuthenticationTokenFilter;
import com.ailanyin.common.security.filter.RateLimitFilter;
import com.ailanyin.common.security.filter.XssFilter;
import com.ailanyin.common.security.handle.LogoutHandler;
import com.ailanyin.common.security.handle.NoTokenResult;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ailanyin
 * @version 1.0
 * @since 2022/11/25 0025 下午 16:41
 */
@Configuration
public class SecurityBeanFactory {

    @Bean
    public NoTokenResult noTokenResult() {
        return new NoTokenResult();
    }

    @Bean
    public XssFilter xssFilter() {
        return new XssFilter();
    }

    @Bean
    public LogoutHandler logoutHandler() {
        return new LogoutHandler();
    }

    @Bean
    public RateLimitFilter rateLimitFilter() {
        return new RateLimitFilter();
    }

    @Bean
    public JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter() {
        return new JwtAuthenticationTokenFilter();
    }
}
